package com.yuyu.controller;

import com.yuyu.bean.OrderItem;
import com.yuyu.service.OrderItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

@Controller
public class OrderItemController {
    @Autowired
    private OrderItemService orderItemService;

    @RequestMapping("/addOrderItem")
    @ResponseBody
    public Map addOrderItem(OrderItem orderItem){
        int result = orderItemService.addOrderItem(orderItem);
        Map<String,Object> map = new HashMap<>();
        map.put("state_code",result);
        return map;
    }
}
